package ProxyPattern;

public class Test {
    public static void main(String[] args) {
        AdminFactory adminFactory = new AdminFactory();
        User zhangsan = adminFactory.creatUser("zhangsan", "223");
        NormalFactory normalFactory = new NormalFactory();
        User lisi = normalFactory.creatUser("lisi", "221");
        User wangwu = normalFactory.creatUser("wangwu", "222");
        zhangsan.menu();
        ProxyUser proxyAdminUser = new ProxyUser(zhangsan);
        proxyAdminUser.addBook("水浒传");
        wangwu.menu();
        ProxyUser proxyNormalUser = new ProxyUser(lisi);
        proxyNormalUser.addBook("西游记");
    }
}
